﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SYH.Utils.SMS
{
    public class SendSms
    {
        #region 参数
        private string _name;
        private string _pass;
        private string _telPhone;
        private string _code;
        private string _operation;
        private string _company;

        /// <summary>
        /// 账户
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        /// <summary>
        /// 密码
        /// </summary>
        public string Pass
        {
            get { return _pass; }
            set { _pass = value; }
        }

        public string TelPhone
        {
            get { return _telPhone; }
            set { _telPhone = value; }
        }

        public string Code
        {
            get { return _code; }
            set { _code = value; }
        }

        public string Operation
        {
            get { return _operation; }
            set { _operation = value; }
        }
        public string Company
        {
            get { return _company; }
            set { _company = value; }
        }

        #endregion

        public SendSms(string TelPhone, string Code, string Operation, string Company)
        {
            this.Name = SYH.Config.WebConfig.SmsName;
            this.Pass = SYH.Config.WebConfig.SmsPass;
            this.TelPhone = TelPhone;
            this.Code = Code;
            this.Operation = Operation;
            this.Company = Company;
        }

        /// <summary>
        /// 发送验证码
        /// </summary>
        /// <returns></returns>
        public string SmsSendCode()
        {
            string result = string.Empty;
            //try
            //{
            //    SmsService.SmsServiceSoapClient client = new SmsService.SmsServiceSoapClient();
            //    result = client.SmsSendCode(Name, Pass, TelPhone, Code, Operation, Company);
            //}
            //catch (Exception e)
            //{
            //    LoggerHelper.Write(DateTime.Now.ToString() + "系统发送短信失败:" + e.ToString());
            //}
            return result;
        }
    }
}
